package ch5;

public class Voter {
	private String name;
	private static int num = 0;

	public Voter(String n) {
		this.name = n;
	}

	public void vote(String to) {
		if (num >= 100) {
			System.out.println("投票结束了");
			return;
		}
		System.out.println(name + "投给了" + to);
		num++;
	}
}
